var $ = require('jquery');

var resp = {
	"status": 200,
	"message": "登录成功！",
	"error": "",
	"data": {
		"name": "丁琼",
		"sessionid": "ff010d6cbe554ad09f40e34607cebe3d"
	}
};

var mockScores = [{
	"id": 1,
	"userid": 1,
	"course": 1,
	"score": 56,
	"createtime": "2016-12-04 23:15:20"
}];

module.exports = {

	login: function(username, password, callback) {
		$.post('/api/user/login', {
			username: username,
			password: password
		}, callback);
		//	callback(resp);
	},
	//查询历史成绩
	getHisScores: function(sessionid, course,callback) {
		$.getJSON('/api/marks/', {
					sessionid: sessionid,
					course: course,
				},
				callback);
			//	callback(mockScores);
	}

}